package dongtaiguihua;

public class _04斐波那契 {
    public static void main(String[] args) {
        System.out.println(fib(5));
    }

    static int fib(int n ) {
        int[] a = new int[n+1];
        a[0]=0;
        a[1]=1;
        for (int i =2 ;i <=n;i++){
            a[i] = a[i-1] +a[i-2];
        }
        return a[n];
    }
}
